import  re
#演示默认情况
pattern = r'apple'
string = 'Apple is a fruit.'
match = re.match(pattern, string)
print(match)    #None,区分大小写，“Apple”与"apple"不匹配

#演示非默认情况，传递flags参数
match = re.match(pattern, string, flags=re.IGNORECASE)
print(match)